#include "stdafx.h"
#include "LDlgtype.h"


LDlgtype::LDlgtype(void)
{
	mlthisdlg = NULL;
}


LDlgtype::~LDlgtype(void)
{
}

int LDlgtype::sync( bool bui )
{
	return 0;
}
void LDlgtype::syncShow( bool b )
{	
	sync( b );
	showDlg( b );
}
void LDlgtype::showDlg( bool b )
{
	mlthisdlg->ShowWindow( b ? SW_SHOW : SW_HIDE );
}
int LDlgtype::createDlg( )
{
	mlthisdlg->Create(  mldlgid );
	return 0;
}
bool LDlgtype::getCk( uint id)
{
	return ( (CButton*)mlthisdlg->GetDlgItem( id ) )->GetCheck();
}
void LDlgtype::setCk(uint id, int ck)
{
	( (CButton*)mlthisdlg->GetDlgItem( id ) )->SetCheck( ck );
}

void LDlgtype::setWt(uint id, CString s)
{
	mlthisdlg->GetDlgItem( id )->SetWindowText( s );
}
void LDlgtype::setWtd(uint id, int d )
{
	CString s;
	s.Format( TEXT("%d") , d);	
	setWt( id, s );
}
void  LDlgtype::setWtf( uint id, double f, bool isf )
{
	CString s;
	if( isf)
	{
		s.Format(TEXT("%.2f"), f);
		setWt( id, s );
	}
	else
	{
		setWtd( id, (int)f );
	}

}


CString LDlgtype::getWt(uint id)
{
	CString s;
	mlthisdlg->GetDlgItem( id )->GetWindowText( s );
	return s;
}
int LDlgtype::getWtd( uint id )
{
	CString s = getWt( id );
	return atoi( s );
}
double LDlgtype::getWtf(uint id)
{
	CString s = getWt( id );
	return atof( s );
}


void LDlgtype::setCbsel(uint id, int idx)
{
	( (CComboBox*)mlthisdlg->GetDlgItem( id ) )->SetCurSel( idx );
}
int LDlgtype::getCbsel(uint id)
{
	return ( (CComboBox*)mlthisdlg->GetDlgItem( id ) )->GetCurSel(   );
}

void LDlgtype::setEdTxt(uint id, int d)
{

}